<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1 id="count">1</h1>
        <button id="btn">add</button>
    </div>
    <script>
        let count = 1;
        const btn =document.getElementById('btn')
        const h1 =document.getElementById('count')
        btn.addEventListener('click',()=>{
            count++
            h1.innerHTML=count;
        })
    </script>
</body>
</html>